<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="demo-form-inline">
      <el-form-item label="ID" prop="userId">
        <el-input v-model="queryParams.userId" placeholder="id" />
      </el-form-item>


      <el-form-item label="开始日期" prop="startTime">
        <el-date-picker v-model="queryParams.startTime" type="datetime" placeholder="选择开始日期"
          value-format="yyyy-MM-dd HH:mm:ss" />
      </el-form-item>
      <el-form-item label="结束日期" prop="endTime">
        <el-date-picker v-model="queryParams.endTime" type="datetime" placeholder="选择结束日期"
          value-format="yyyy-MM-dd HH:mm:ss" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
        <el-button type="primary" @click="reset">重置</el-button>
      </el-form-item>
    </el-form>

    <el-table v-loading="listLoading" :data="list" element-loading-text="Loading" border fit highlight-current-row>
      <el-table-column align="center" label="序号" width="95">
        <template slot-scope="scope">
          {{ scope.$index }}
        </template>
      </el-table-column>

      <el-table-column label="累计提现通过金额" prop="approved" align="center" />
      <el-table-column label="累计驳回提现金额" prop="rejected" align="center" />
      <el-table-column label="累计提现审核中的金额" prop="applying" align="center" />
      <el-table-column label="所有无限代下级加上自己的的审核过提现总额" prop="all" align="center" />
    </el-table>

  </div>
</template>

<script>
import { withdrawById } from '@/api/table'
export default {
  components: {

  },
  data() {
    return {
      list: null,
      listLoading: false,
      queryParams: {
        'pageNum': 1,
        'pageSize': 10,
        'userId': ''
      }
    }
  },
  methods: {

    fetchData() {
      this.listLoading = true
      withdrawById(this.queryParams).then(response => {
        this.list = [response.data]
        this.listLoading = false
      })
    },

    onSubmit() {
      this.queryParams.page = 1
      this.fetchData()
    },
    reset() {
      this.queryParams = {
        'userId': '',
        'pageNum': 1,
        'pageSize': 10,
      }
      this.fetchData()
    },


  }
}
</script>
